import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/login1',
    name: 'Login1',
    component: () => import('../views/doctorLogin')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register')
  },
  {
    path: '/',
    name: '用户界面',
    component: () => import('../layout'),
    redirect: '/login',
    children: [
      {
        path: '/user/index',
        name: '首页',
        component: () => import('@/views/first')
      },
      {
        path: '/user/yuyue',
        name: '预约挂号',
        component: () => import('@/views/worktime')
      },
      {
        path: '/user/recode',
        name: '我的预约',
        component: () => import('@/views/recode')
      },
      {
        path: '/user/yuyue1',
        name: '按科室挂号',
        component: () => import('@/views/yuyue1')
      },
      {
        path: '/user/yuyue1-1',
        name: '预约挂号1-1',
        component: () => import('@/views/yuyue1-1')
      },
      {
        path: '/user/modifyPwd',
        name: '修改密码',
        component: () => import('@/views/modifyPwd')
      },
      {
        path: '/user/info',
        name: '个人信息',
        component: () => import('@/views/myInfo')
      },
      {
        path: '/user/yuyue1-2',
        name: '医生信息',
        component: () => import('@/views/doctorMessage')
      }
    ]
  },
  {
    path: '/doctor',
    name: '医生界面',
    component: () => import('../layout-2'),
    redirect: '/doctor/apply',
    children: [
      {
        path: '/doctor/apply',
        name: '我的申请',
        component: () => import('@/views/doctorApply')
      },
      {
        path: '/doctor/recode',
        name: '患者队列',
        component: () => import('@/views/doctorRecode')
      },
      {
        path: '/doctor/info',
        name: '医生个人信息',
        component: () => import('@/views/doctorInfo')
      },
      {
        path: '/doctor/modifyPwd',
        name: '医生修改密码',
        component: () => import('@/views/doctorModifyPwd')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
